Skip to content

Conversation

@jrainville
Copy link
Member

Fixes status-im/status-desktop#18344

Removes the duplication that was introduced during the Local backup Epic.

Also removes most of the Messenger access from the Accounts service. I couldn't remove it all, because first it was already used before the local backup was introduced and I still need the Messenger's signal manager. I tried using the WalletFeed and introducing a new Feed, but both of those didn't work.

Finally, this PR removes some no longer used signals and removes the name Waku from the backup signals, since they are no longer related or using Waku.

@status-im-auto
Copy link
Member

status-im-auto commented Sep 29, 2025

Jenkins Builds

Click to see older builds (24)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 16f8892 #1 2025-09-29 19:07:32 ~3 min macos/status-go 📦zip
✔️ 16f8892 #1 2025-09-29 19:07:45 ~3 min linux/status-go 📦zip
✔️ 16f8892 #1 2025-09-29 19:10:40 ~6 min windows/status-go 📦zip
✖️ 16f8892 #1 2025-09-29 19:14:17 ~10 min tests-rpc 📄log
✔️ 16f8892 #1 2025-09-29 19:15:06 ~10 min linux/nwaku 📦zip
✔️ 16f8892 #1 2025-09-29 19:32:47 ~28 min tests 📄log
✔️ 030a26f #2 2025-09-29 20:04:55 ~3 min macos/status-go 📦zip
✔️ 030a26f #2 2025-09-29 20:08:15 ~6 min windows/status-go 📦zip
✔️ 030a26f #2 2025-09-29 20:20:44 ~19 min linux/status-go 📦zip
✔️ 030a26f #2 2025-09-29 20:30:57 ~29 min linux/nwaku 📦zip
✔️ 030a26f #2 2025-09-29 20:31:05 ~29 min tests-rpc 📄log
✔️ 030a26f #2 2025-09-29 20:47:35 ~45 min tests 📄log
✔️ 4c5b94f #3 2025-09-30 17:32:22 ~3 min macos/status-go 📦zip
✔️ 4c5b94f #3 2025-09-30 17:33:17 ~4 min linux/status-go 📦zip
✔️ 4c5b94f #3 2025-09-30 17:35:44 ~6 min windows/status-go 📦zip
✔️ 4c5b94f #3 2025-09-30 17:39:05 ~10 min tests-rpc 📄log
✔️ 4c5b94f #3 2025-09-30 17:41:47 ~12 min linux/nwaku 📦zip
✔️ 4c5b94f #3 2025-09-30 17:55:22 ~26 min tests 📄log
✔️ b85cac1 #4 2025-10-02 18:19:36 ~3 min macos/status-go 📦zip
✔️ b85cac1 #4 2025-10-02 18:19:44 ~3 min linux/status-go 📦zip
✔️ b85cac1 #4 2025-10-02 18:22:58 ~6 min windows/status-go 📦zip
✔️ b85cac1 #4 2025-10-02 18:27:09 ~11 min linux/nwaku 📦zip
✔️ b85cac1 #4 2025-10-02 18:27:44 ~11 min tests-rpc 📄log
✔️ b85cac1 #4 2025-10-02 18:45:35 ~29 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 45aa32b #5 2025-10-03 14:06:00 ~3 min macos/status-go 📦zip
✔️ 45aa32b #5 2025-10-03 14:06:16 ~3 min linux/status-go 📦zip
✔️ 45aa32b #5 2025-10-03 14:10:17 ~7 min windows/status-go 📦zip
✔️ 45aa32b #5 2025-10-03 14:13:07 ~10 min linux/nwaku 📦zip
✖️ 45aa32b #5 2025-10-03 14:13:13 ~10 min tests-rpc 📄log
✔️ 45aa32b #5 2025-10-03 14:29:37 ~26 min tests 📄log
✔️ 2d8673c #6 2025-10-03 14:54:33 ~3 min macos/status-go 📦zip
✔️ 2d8673c #6 2025-10-03 14:59:15 ~8 min linux/status-go 📦zip
✔️ 2d8673c #6 2025-10-03 14:59:42 ~8 min windows/status-go 📦zip
✔️ 2d8673c #6 2025-10-03 15:07:12 ~16 min linux/nwaku 📦zip
✔️ 2d8673c #6 2025-10-03 15:09:45 ~18 min tests-rpc 📄log
✔️ 2d8673c #6 2025-10-03 15:28:28 ~37 min tests 📄log

@jrainville
Copy link
Member Author

This is a breaking change since I removed some signals, but they were not used anymore, and if they were, they weren't handled, just caught.

Desktop PR: status-im/status-desktop#18926

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 33.51955% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.52%. Comparing base (5bd4984) to head (2d8673c).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
protocol/syncing/syncing.go 47.42% 39 Missing and 12 partials ⚠️
services/accounts/service.go 12.12% 29 Missing ⚠️
protocol/backupsync/response.go 0.00% 16 Missing ⚠️
protocol/messenger_backup_handler.go 20.00% 8 Missing ⚠️
services/ext/signal.go 0.00% 4 Missing ⚠️
signal/events_backup_sync.go 0.00% 4 Missing ⚠️
services/wallet/service.go 0.00% 3 Missing ⚠️
protocol/messenger_testing_utils.go 0.00% 2 Missing ⚠️
protocol/backupsync/profile_response.go 75.00% 1 Missing ⚠️
protocol/messenger_handler.go 75.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (33.51%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6967      +/-   ##
===========================================
+ Coverage    55.34%   59.52%   +4.18%     
===========================================
  Files          833      834       +1     
  Lines       120215   120103     -112     
===========================================
+ Hits         66529    71490    +4961     
+ Misses       46706    41336    -5370     
- Partials      6980     7277     +297     
Flag Coverage Δ
functional 32.59% <10.05%> (?)
unit 55.41% <31.28%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/geth_backend.go 52.80% <100.00%> (+3.42%) ⬆️
node/status_node_services.go 78.76% <100.00%> (+0.08%) ⬆️
protocol/messenger_config.go 94.11% <ø> (ø)
protocol/messenger_sync_settings.go 71.00% <ø> (+12.35%) ⬆️
protocol/backupsync/profile_response.go 75.00% <75.00%> (ø)
protocol/messenger_handler.go 55.02% <75.00%> (+0.97%) ⬆️
protocol/messenger_testing_utils.go 82.68% <0.00%> (+8.63%) ⬆️
services/wallet/service.go 73.02% <0.00%> (+8.75%) ⬆️
services/ext/signal.go 22.22% <0.00%> (+22.22%) ⬆️
signal/events_backup_sync.go 0.00% <0.00%> (ø)
... and 4 more

... and 200 files with indirect coverage changes

@jrainville jrainville force-pushed the refactor/backup-cleanup-and-deduplication branch from 16f8892 to 030a26f Compare September 29, 2025 20:01
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this file and removed FetchingDataProgress

}

// TODO use a new feed for accounts service events
s.messenger.PublishSettingEvent(settingField)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part where I couldn't get rid of the messenger. I didn't manage to make another event feed work

b.config,
b.accountsPublisher,
mediaServer,
b.logger.Named("accountsService"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
b.logger.Named("accountsService"),
b.logger.Named("AccountsService"),

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to have a common place and don't duplicate the code. But ideally this shouldn't be here 😄

Neither Messenger or protocol should be responsible for putting data into the database. Accounts service is the right place for this procedure. So in perfect world, protocol would just pass the message to certain service (Accounts in this case) for handling.

But... this is not doable at the moment, so let's leave it as you did it for now 🤷 Would be great if you can leave a comment mentioning this. When we refactor the protocol/messenger package in proper way, we will address this.

@jrainville jrainville force-pushed the refactor/backup-cleanup-and-deduplication branch 2 times, most recently from 4c5b94f to b85cac1 Compare October 2, 2025 18:15
@jrainville
Copy link
Member Author

@igor-sirotin I'm not sure the code coverage is working well here. I mostly moved or removed code. It seems like it counts some of the removals I made as lowering the coverage, which is weird.

Do you think it's ok to force merge?

@jrainville jrainville force-pushed the refactor/backup-cleanup-and-deduplication branch from b85cac1 to 45aa32b Compare October 3, 2025 14:02
Moves HandleSyncWatchOnlyAccount to the new syncing package where it is shared by the wallet service and the messenger. Removing the messenger dependency and duplication
Fixes status-im/status-desktop#18344

Removes the duplication in the accounts service by moving the shared code to the syncing module.

Removes as much as much as possible the use of the Messenger. The signal sending still uses the Messenger for now.
@jrainville jrainville force-pushed the refactor/backup-cleanup-and-deduplication branch from 45aa32b to 2d8673c Compare October 3, 2025 14:50
@igor-sirotin
Copy link
Collaborator

force-merging as the code was mostly moved around

@igor-sirotin igor-sirotin merged commit 3386609 into develop Oct 3, 2025
20 of 21 checks passed
@igor-sirotin igor-sirotin deleted the refactor/backup-cleanup-and-deduplication branch October 3, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LocalBackup] Remove duplication and Messenger access from Backup functions

4 participants